#pragma once

#include "FXValue.h"
#include "util.h"

class Effect;
/**
* Base class for float parameters.
* Implemented for DirectX in the FXParameter class.
* Implemented for OpenGL in the OpenGLShaderParameter class.
* @author Koen Samyn
*/
class FXParameter
{
public:
	/**
	* Creates a new ShaderParameter object.
	* @param name the name of the parameter.
	* @param semantic the semantic of the parameter.
	*/
	FXParameter(tstring name, tstring semantic);
	/**
	* Destroys the ShaderParameter object.
	*/
	virtual ~FXParameter(void);
	/**
	* Passes the value of the parameter to the shader.
	* @param device the device to use (mostly for matrix calculations)
	* @param effect the shader to pass the value to.
	*/
	//virtual void SetParameterInEffect(Device3D* device,Effect* effect)=0;
	/**
	* Returns true if this parameter can be automatically mapped 
	* with the application.
	* @return true if the parameter has a special semantic that 
	* can be automatically mapped, false otherwise.
	*/
	bool isAutoWired(){
		return m_AutoWired;
	}
	/**
	* Set to true if this parameter can be automatically mapped
	* with the application.
	* @param autoWired pass true if this parameter can be automatically
	* mapped with a shader parameter.
	*/
	void setAutoWired(bool autoWired){
		m_AutoWired = autoWired;
	}
	/**
	* Returns the name of this parameter.
	* @return the name of the parameter.
	*/
	const tstring& GetName() const{
		return m_Name;
	}
	/**
	* Returns the semantic of this parameter.
	* @return the semantic of the parameter.
	*/
	const tstring& GetSemantic() const{
		return m_Semantic;
	}
	/**
	* Sets the value that will be passed to the shader.
	* @param value the value that will be passed to the shader.
	*/
	void SetValue(const FXValue * value){m_Value=value;}
	/**
	* Returns the value that will be passed to the shader.
	* @return the value that will be passed to the shader.
	*/
	const FXValue* GetValue(){return m_Value;}
	/**
	* Creates a clone of this ShaderParameter.
	* @return the cloned ShaderParameter object.
	*/
	virtual FXParameter* Clone()=0;
protected:
	/**
	* The value of this ShaderParameter object.
	*/ 
	const FXValue* m_Value;
	/**
	* The name of the parameter.
	*/
	tstring m_Name;
	/**
	* The semantic value of the parameter.
	*/
	tstring m_Semantic;
private:
	/**
	* Indicates if this parameter can be automatically 
	* coupled with the shader.
	*/
	bool m_AutoWired;
	
	
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	FXParameter(const FXParameter& t);
	FXParameter& operator=(const FXParameter& t);
};
